package
        com.zzc.fee.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hos.entity.his.CheckResult;
import com.hos.entity.stock.Provider;
import com.hos.entity.sys.Comment;
import com.hos.entity.sys.User;
import com.hos.vo.Result;
import com.zzc.fee.mapper.CommentMapper;
import com.zzc.fee.mapper.UserMapper;
import com.zzc.fee.service.CommentService;
import com.zzc.fee.vo.CommentVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;

/**
 * @author：xIAO_ZHOU_TX
 * @date：Created in 2024/1/2 17:27
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class CommentServiceImpl implements CommentService {
    @Resource
    private CommentMapper commentMapper;
    @Resource
    private UserMapper userMapper;

    @Override
    public List<Comment> queryAllNew(CommentVo commentVo) {
        return  commentMapper.queryAllNew(commentVo.getValueId(),commentVo.getDateRange(),commentVo.getName());
    }


    // public Page<Comment> queryAllNew(CommentVo commentVo) {
    //     Page<Comment> page =new Page<>(commentVo.getPageNum(),commentVo.getPageSize());
    //     LambdaQueryWrapper<Comment> wrapper =new LambdaQueryWrapper<>();
    //     LambdaQueryWrapper<User> userWrapper =new LambdaQueryWrapper<>();
    //     // userMapper.selectById(commentVo.getValueId());
    //     //医生id
    //     if(Objects.nonNull(commentVo.getValueId())){
    //             wrapper.eq(Comment::getValueId,commentVo.getValueId());
    //     }
    //     if(Objects.nonNull(commentVo.getDeleted()) && commentVo.getDeleted()==0){
    //         wrapper.eq(Comment::getDeleted,commentVo.getDeleted());
    //     }
    //     //创建时间
    //     if (Objects.nonNull(commentVo.getDateRange())) {
    //         wrapper.between(Comment::getAddTime, commentVo.getDateRange()[0], commentVo.getDateRange()[1]);
    //     }
    //     return commentMapper.selectPage(page,wrapper);
    // }


    @Override
    public User getdocNameById(Long valueId) {

        return userMapper.selectById(valueId);
    }

    @Override
    public Integer deleteNewByIds(List<Long> ids) {
        return commentMapper.deleteBatchIds(ids);
    }
}